﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Data;
using PSE.Framework.UI.Controls.SmartClient.Edit;
using PSE.Framework.UI.Controls.SmartClient.Validation;

namespace PSE.Framework.UI.Controls.SmartClient
{
    public class Field : DependencyObject
    {
        #region Construtor
        /// <summary>
        /// Construtor padrão
        /// </summary>
        public Field()
            : base()
        {
        }
        #endregion

        #region Name
        public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(Field), new FrameworkPropertyMetadata());
        /// <summary>
        /// Nome do campo
        /// </summary>
        public string Name
        {
            get { return (string)GetValue(NameProperty); }
            set { SetValue(NameProperty, value); }
        }
        #endregion

        #region Path
        public static readonly DependencyProperty PathProperty = DependencyProperty.Register("Path", typeof(string), typeof(Field), new FrameworkPropertyMetadata(null));
        /// <summary>
        /// Caminho da property
        /// </summary>
        public string Path
        {
            get { return (string)GetValue(PathProperty); }
            set { SetValue(PathProperty, value); }
        }
        #endregion

        #region StringFormat
        public static readonly DependencyProperty StringFormatProperty = Column.StringFormatProperty.AddOwner(typeof(Field));
        /// <summary>
        /// String de formatação do valor
        /// </summary>
        public string StringFormat
        {
            get { return (string)GetValue(StringFormatProperty); }
            set { SetValue(StringFormatProperty, value); }
        }
        #endregion

        #region AllowSort
        public static readonly DependencyProperty AllowSortProperty = Column.AllowSortProperty.AddOwner(typeof(Field));
        /// <summary>
        /// Indica se a coluna permite ordenação
        /// </summary>
        public bool AllowSort
        {
            get { return (bool)GetValue(AllowSortProperty); }
            set { SetValue(AllowSortProperty, value); }
        }
        #endregion

        #region SortDirection
        public static readonly DependencyProperty SortDirectionProperty = DependencyProperty.Register("SortDirection", typeof(ListSortDirection), typeof(Field), new FrameworkPropertyMetadata(ListSortDirection.Ascending));
        /// <summary>
        /// Ordem do campo
        /// </summary>
        public ListSortDirection SortDirection
        {
            get { return (ListSortDirection)GetValue(SortDirectionProperty); }
            set { SetValue(SortDirectionProperty, value); }
        }
        #endregion

        #region AllowGroup
        public static readonly DependencyProperty AllowGroupProperty = Column.AllowGroupProperty.AddOwner(typeof(Field), new FrameworkPropertyMetadata(true));
        /// <summary>
        /// Indica se a coluna permite agrupamento
        /// </summary>
        public bool AllowGroup
        {
            get { return (bool)GetValue(AllowGroupProperty); }
            set { SetValue(AllowGroupProperty, value); }
        }
        #endregion

        #region AllowExportExcel
        public static readonly DependencyProperty AllowExportExcelProperty = Column.AllowExportExcelProperty.AddOwner(typeof(Field));
        /// <summary>
        /// Indica se a coluna permite ser exportada para Excel
        /// </summary>
        public bool AllowExportExcel
        {
            get { return (bool)GetValue(AllowExportExcelProperty); }
            set { SetValue(AllowExportExcelProperty, value); }
        }
        #endregion

        #region AllowCopyClipboard
        public static readonly DependencyProperty AllowCopyClipboardProperty = Column.AllowCopyClipboardProperty.AddOwner(typeof(Field));
        /// <summary>
        /// Indica se a coluna permite ser copiada para a área de transferência
        /// </summary>
        public bool AllowCopyClipboard
        {
            get { return (bool)GetValue(AllowCopyClipboardProperty); }
            set { SetValue(AllowCopyClipboardProperty, value); }
        }
        #endregion
    }
}
